package com.hzit.sb2.util.weixin;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class MessageUtil {
    @Autowired
    HttpClientUtil httpClientUtil;
    @Autowired
    AccessTokenUtil accessTokenUtil;

    public String sendTxtMsg(String rbody){
        //https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN
        String token = accessTokenUtil.getAccessToken();
        String url = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token="+token;
        String result = httpClientUtil.post(url, rbody);
        return result;
    }
}
